package com.usian.service.impl;

import com.usian.mapper.FunctionMapper;
import com.usian.pojo.Function;
import com.usian.service.FunctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FunctionServiceImpl implements FunctionService  {

    @Autowired
    private FunctionMapper functionMapper;

    @Override
    public List<Function> findAll() {
        List<Function> functions = functionMapper.findAll();
        return functions;
    }

    @Override
    public void add(Function function) {
        functionMapper.insert(function);
    }

    @Override
    public Function findById(Integer zid) {
        Function function = functionMapper.findById(zid);
        return function;
    }

    @Override
    public void update(Function function) {
        functionMapper.updateByPrimaryKeySelective(function);
    }

    @Override
    public boolean del(Integer zid) {
        functionMapper.deleteByPrimaryKey(zid);
        return false;
    }
}
